<?php
$title = 'Восстановление пароля';
include_once 'inc/fnc.php';
if(isset($_GET['submit'])){
        $name = trim(htmlspecialchars($_POST['name']));
        $q = $db->fetch('SELECT * FROM `users` WHERE `login`=? AND `email` !=?',array($name,0));
        $q1 = $db->rows('SELECT * FROM `users` WHERE `login`=?',array($name));
        if(!$q['email']){
            
            $_SESSION['error'] = '<div class="plate_err mtb5 mlr10">
<div class="plate_err_b">
<div class="plate_err_l">
<div class="plate_err_r">
<div class="plate_err_rt">
<div class="plate_err_rb">
<div class="plate_err_lt">
<div class="plate_err_lb cntr">
У игрока с таким именем не найден email
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>';
header('location:./restore');
exit;

        }
        if($q1 == 0){
        $_SESSION['error']='<div class="cntr">
<div class="plate_err mtb5 mlr10">
<div class="plate_err_b">
<div class="plate_err_l">
<div class="plate_err_r">
<div class="plate_err_rt">
<div class="plate_err_rb">
<div class="plate_err_lt">
<div class="plate_err_lb cntr">
Игрок с таким именем не найден
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>';
header('location:./restore');
exit;
        }
}
?>
<div class="header">
<div class="header_in pt15 pb5">
<div class="page_title">
<div class="page_title_in">Восстановление пароля</div>
</div>
</div>
</div>
<div class="cntr m10">

<form id="id1" method="post" action="./restore?submit"><div style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hidden"><input type="hidden" name="id1_hf_0" id="id1_hf_0"></div>
<label>Введите Ваше игровое имя:</label><br>
<input type="text" name="name" class="typetext" value=""><br>
<span class="btn_g w120 mt5"><span class="btn_g_in"><input type="submit" value="Отправить"></span></span>
</form>
<div class="hr mt10 mb10"></div>
<a href="/">Главная</a><br>







</div>
<?php
include_once 'inc/foot.php';
